<?php
error_reporting(0); 
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/> 
<meta name="Description" content="人生没有彩排，每天都是现场直播…当你怀旧时，当你迷茫时，当你看不到未来时，你有没有想过 ，今天是你生命中的第几天? 好好享受并且感谢生命中的每一天，一起来测测吧！"/>
<?php if($_GET['name']){  $enddate=date("y-m-d",time());
$bank = "-";
$start = $_GET['year'].$bank.$_GET['month'].$bank.$_GET['day'];
$startdate=strtotime($start);
$enddate=strtotime($enddate);
$days=round(($enddate-$startdate)/3600/24) +1;?>
<title>我是<?=$_GET['name']?>,今天是我生命中的第<?=$days?>天</title>
<?php } else {?>
<title>今天是我生命中的第几天</title>
<?php } ?>
<link type="text/css" rel="stylesheet" href="../css/frozen.css" />
<style>
.ui-header-positive, .ui-footer-positive {
background-color: #f05557;
color: #fff;
}
a {
color: #f05557;
}
</style>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?c9bd9af864cecc875908d916a3f48e44";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body ontouchstart="">
<?php if($_GET['name']){?>
    <header class="ui-header ui-header-positive ui-border-b">
	<h1>长按下方图片点选保存图片</h1>
</header>
<div class="wrapper"><br><br>
	<img src="toutu.php?name=<?=$_GET['name']?>&year=<?=$_GET['year']?>&month=<?=$_GET['month']?>&day=<?=$_GET['day']?>" width="100%"/>
    <br/><center><h1>我，叫<?=$_GET['name']?></h1></center><br/><center><h1>人生没有彩排，每天都是现场直播。</h1></center><br/><center><h1>我要做的，就是演好每一场戏。</h1></center><br/><center><h1>据说，人的一生共有30000个日日夜夜，</h1></center><br/><center><h1>而我已经走过了其中的<?=$days?>天，</h1></center><br/><center><h1>剩下的<?=30000-$days?>天的可能里，</h1></center><br/><center><h1>我都会为了追逐远方，努力生活。</h1></center><br/>
</div>

<?php require_once 'foot1.php';}else{ ?>
<header class="ui-header ui-header-positive ui-border-b">
	<h1><?php date("y-m-d",time())?>今天是我生命中的第几天</h1>
</header>
<div class="wrapper"><br>
	<img src="myday1.png" width="50%" style="margin:30px 25%;"/>
	<div class="ui-form">
    	<form action="">
        	<div class="ui-form-item ui-border-b">
            	<label for="#">姓名</label>
            	<input type="text" name="name" placeholder="输入你的姓名"/>
        	</div>
			<div class="ui-form-item ui-border-b">
            	<label>选择出生年</label>
            	<div class="ui-select">
                	<select name="year">
                	<?php for($i=2016;$i>=1949;$i--){?>
                    	<option value ="<?=$i?>"><?=$i?>年</option>
                    <?php }?>
                	</select>
            	</div>
        	</div>
            <div class="ui-form-item ui-border-b">
                <label>选择出生月</label>
                <div class="ui-select">
                    <select name="month">
                    <?php for($j=1;$j<=12;$j++){?>
                        <option value ="<?=$j?>"><?=$j?>月</option>
                    <?php }?>
                    </select>
                </div>
            </div>
               <div class="ui-form-item ui-border-b">
                <label>选择出生日</label>
                <div class="ui-select">
                    <select name="day">
                    <?php for($k=1;$k<=31;$k++){?>
                        <option value ="<?=$k?>"><?=$k?>日</option>
                    <?php }?>
                    </select>
                </div>
            </div>
			<div class="ui-btn-wrap">
    			<button class="ui-btn-lg ui-btn-danger">开始计算</button>
			</div>
    	</form>
	</div>
		<?php 
require_once 'foot.php';
} 
?>
</body>
</html>
